#!/bin/bash

if [ -z $1 ]
then
	echo " location can not be null"
	exit 1
else	
	PROJECT_DIR=$1
fi

# 查找脚本自身所在目录
SOURCE="$0"
while [ -h "$SOURCE"  ]; do # resolve $SOURCE until the file is no longer a symlink
	DIR="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"
	SOURCE="$(readlink "$SOURCE")"
	[[ $SOURCE != /*  ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"

echo $DIR 
echo $PROJECT_DIR


mkdir -p $DIR/${PROJECT_DIR}/controller

mkdir -p $DIR/${PROJECT_DIR}/entity

mkdir -p $DIR/${PROJECT_DIR}/entity/bean

mkdir -p $DIR/${PROJECT_DIR}/entity/po

mkdir -p $DIR/${PROJECT_DIR}/mapper
mkdir -p $DIR/${PROJECT_DIR}/mapper/xml

mkdir -p $DIR/${PROJECT_DIR}/service

mkdir -p $DIR/${PROJECT_DIR}/service/impl